import { Component, OnInit } from '@angular/core';
import { UserService } from '../../services/user/user.service';
import { Router } from '@angular/router';

@Component({
  selector: 'app-regist',
  templateUrl: './regist.component.html',
  styleUrls: ['./regist.component.css']
})
export class RegistComponent implements OnInit {

  constructor( private us:UserService ,private router:Router) { }

  userTel:string="";

  initPwd:string;

  ngOnInit() {

  }

  doRegist(){
    this.us.regist(this.userTel).subscribe((data)=>{
      let result = data.json();
      console.log(result);
      if(result.code == "success"){
        this.router.navigate(["/login"]);
    }
    });
  }

}
